package com.lifeverse.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 网络可视化数据传输对象
 */
@Data
public class NetworkVisualizationDTO {
    
    /**
     * 网络节点列表
     */
    private List<NetworkNode> nodes;
    
    /**
     * 网络边列表
     */
    private List<NetworkEdge> edges;
    
    /**
     * 网络统计信息
     */
    private NetworkStatistics statistics;
    
    /**
     * 网络节点
     */
    @Data
    public static class NetworkNode {
        private Long id;
        private String name;
        private String type;
        private String status;
        private BigDecimal size;
        private String color;
        private String label;
        private BigDecimal x;
        private BigDecimal y;
        private Integer degree;
        private BigDecimal centrality;
        private String category;
        private String description;
    }
    
    /**
     * 网络边
     */
    @Data
    public static class NetworkEdge {
        private Long id;
        private Long sourceId;
        private Long targetId;
        private String relationshipType;
        private String relationshipStatus;
        private BigDecimal strength;
        private BigDecimal weight;
        private String color;
        private String label;
        private Boolean directed;
        private BigDecimal width;
    }
    
    /**
     * 网络统计信息
     */
    @Data
    public static class NetworkStatistics {
        private Integer totalNodes;
        private Integer totalEdges;
        private BigDecimal averageDegree;
        private BigDecimal networkDensity;
        private BigDecimal clusteringCoefficient;
        private Integer connectedComponents;
        private BigDecimal averagePathLength;
        private BigDecimal networkDiameter;
        private List<CommunityInfo> communities;
        private List<CentralityRanking> centralityRankings;
    }
    
    /**
     * 社区信息
     */
    @Data
    public static class CommunityInfo {
        private Integer communityId;
        private String communityName;
        private Integer nodeCount;
        private List<Long> nodeIds;
        private BigDecimal modularity;
        private String color;
    }
    
    /**
     * 中心性排名
     */
    @Data
    public static class CentralityRanking {
        private Long nodeId;
        private String nodeName;
        private BigDecimal degreeCentrality;
        private BigDecimal betweennessCentrality;
        private BigDecimal closenessCentrality;
        private BigDecimal eigenvectorCentrality;
        private Integer rank;
    }
}